import {
	apiUrl
} from "./api";
// 获取验证码图片
export const getCodeImg = () => {
	return uni.request({
		// url: 'http://localhost/dev-api/code',
		url: apiUrl.CodeUrl,
		headers: {
			isToken: false
		},
		method: 'get',
		timeout: 20000
	});
}
// login
export const login = (username, password, code, uuid) => {
	return uni.request({
		// url: 'http://localhost:8080/auth/login',
		url: apiUrl.LoginUrl,
		headers: {
			isToken: false,
			repeatSubmit: false
		},
		method: 'post',
		data: {
			username,
			password,
			code,
			uuid
		}
	})
}
export const getUserInfo = (username) => {
	return uni.request({
		url: apiUrl.UserInfoUrl + username,
		method: 'GET',
	});
}
// 注册
export const register = (data) => {
	return uni.request({
		url: apiUrl.RegisterUrl,
		headers: {
			isToken: false
		},
		method: 'post',
		data: data
	})
}
